<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<%@ page session="false" %>
<html>
<head>
	<link rel="stylesheet" href="<c:url value="/resources/css/bootstrap.css" />" >
	<link rel="stylesheet" href="<c:url value="/resources/css/bootstrap-theme.css" />" >
	<link rel="stylesheet" href="<c:url value="/resources/css/carousel.css" />" >
	<script type="text/javascript" src="<c:url value="/resources/js/jquery-2.1.1.js" /> "></script>
	<script type="text/javascript" src="<c:url value="/resources/js/bootstrap.js" /> "></script>
	<title>Home Page</title>
</head>
<body>
	<div class="container">
      <!-- Static navbar -->
      <div class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<spring:url value="/" />">Spring MVC</a>
          </div>
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li class="active"><a href="<spring:url value="/" />">Home</a></li>
              <security:authorize access="! isAuthenticated()">
              <li><a href="<spring:url value="/login" />">Login</a></li>
              </security:authorize>
              <security:authorize access="isAuthenticated()">
              <li><a href="<spring:url value="/listuser" />">List Users</a></li>
              </security:authorize>
              <li><a href="<spring:url value="/register" />">Register</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
              <security:authorize access=" isAuthenticated()" >
              <li><a>Welcome ${pageContext.request.userPrincipal.name}</a></li>
              </security:authorize>
              <security:authorize access=" isAuthenticated()">
               <li><a href="<spring:url value="/logout" />">Logout</a></li>
              </security:authorize>
            </ul>
          </div><!--/.nav-collapse -->
        </div><!--/.container-fluid -->
      </div>
    </div> <!-- /container -->
    
    <div class="container">
    	<c:if test="${not empty message}">
    	<div class="alert alert-success">${message}</div>
    	</c:if>
    	
    	 <!-- Carousel
	    ================================================== -->
	    <div id="myCarousel" class="carousel slide" data-ride="carousel">
	      <!-- Indicators -->
	      <ol class="carousel-indicators">
	        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
	        <li data-target="#myCarousel" data-slide-to="1"></li>
	        <li data-target="#myCarousel" data-slide-to="2"></li>
	      </ol>
	      <div class="carousel-inner">
	        <div class="item active">
	          <img src="<c:url value="/resources/image/topbanner1.jpg" />" alt="First slide">
	          <div class="container">
	            <div class="carousel-caption">
	              <h1>Example headline.</h1>
	              <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p>
	              <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
	            </div>
	          </div>
	        </div>
	        <div class="item">
	          <img src="<c:url value="/resources/image/topbanner2.jpg" />" alt="Second slide">
	          <div class="container">
	            <div class="carousel-caption">
	              <h1>Another example headline.</h1>
	              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
	              <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
	            </div>
	          </div>
	        </div>
	        <div class="item">
	          <img src="<c:url value="/resources/image/topbanner3.jpg" />" alt="Third slide">
	          <div class="container">
	            <div class="carousel-caption">
	              <h1>One more for good measure.</h1>
	              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
	              <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
	            </div>
	          </div>
	        </div>
	      </div>
	      <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
	      <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
	    </div><!-- /.carousel -->
    	
    	
    </div>
    
    <div class="container">
    	<div class="navbar navbar-default navbar-fixed-bottom">
    		<div class="container">
    			<p class="navbar-text">&copy; Hai Nguyen|Java Fresher</p>
    			<a href="#" class="navbar-btn btn btn-danger pull-right"><span class="glyphicon glyphicon-chevron-up"></span>Back To Top</a>
    		</div>
    	</div>
    </div>
    
</body>
</html>
